﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SystemEditor.ascx.cs" Inherits="Admin_LCASystem_Controls_SystemEditor" %>
<%@ Register TagPrefix="uc" TagName="XhtmlEditor"  Src="/Admin/FormControls/XhtmlEditor.ascx" %>
<%@ Register TagPrefix="uc" TagName="ImageSelector"  Src="/Admin/FormControls/ImageSelector.ascx" %>
<%@ Register TagPrefix="uc" TagName="FileSelector"  Src="/Admin/FormControls/FileSelector.ascx" %>
<%@ Register TagPrefix="uc" TagName="InputOutput"  Src="/Admin/LCASystem/Controls/InputOutput.ascx" %>
<%@ Register TagPrefix="uc" TagName="TransportationA"  Src="/Admin/LCASystem/Controls/TransportationA.ascx" %>
<%@ Register TagPrefix="uc" TagName="TransportationB"  Src="/Admin/LCASystem/Controls/TransportationB.ascx" %>

<style type="text/css">
    .footer-container
    {
        display: none;
    }
</style>
<h1><asp:Literal ID="litItemHeader" runat="server"/></h1>
<div class="system-editor formview">
    <div class="section">
        <div class="section-title">
            General Information</div>
        <div class="row">
            <div class="label">
                Name</div>
            <div class="input">
                <asp:TextBox ID="txtName" runat="server" ClientIDMode="Static"></asp:TextBox>
                <asp:RequiredFieldValidator ID="vldName" ControlToValidate="txtName" 
                    ErrorMessage="Required" Display="Dynamic" SetFocusOnError="true" 
                    CssClass="errormessage" runat="server"></asp:RequiredFieldValidator>
            </div>
        </div>
        <div class="row">
            <div class="label">
                Description
            </div>
            <div class="input">
                 <uc:XhtmlEditor ID="rteDescription" Height="350px" Width="700px" runat="server" />
            </div>
        </div>
        <div class="row">
            <div class="amount pull-left">
                <div class="label">
                    Amount</div>
                <div class="input">
                    <asp:TextBox ID="txtAmount" runat="server" ClientIDMode="Static"></asp:TextBox>
                    
                </div>
            </div>
            <div class="unit pull-left">
                <div class="label">
                    Unit
                </div>
                <div class="input">
                     <asp:DropDownList runat="server" ID="ddlUnit" DataValueField="Id" DataTextField="Name" ClientIDMode="Static"></asp:DropDownList>
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="ddlUnit"  InitialValue="NULL"
                        ErrorMessage="Required" Display="Dynamic" SetFocusOnError="true" 
                        CssClass="errormessage" runat="server"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="clearfix"></div>

        </div>
        <div class="row amount-validator">
            <div class="label"></div>
            <div class="input">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtAmount" 
                    ErrorMessage="Required" Display="Dynamic" SetFocusOnError="true" 
                    CssClass="errormessage" runat="server"></asp:RequiredFieldValidator>
<%--                <asp:RegularExpressionValidator ID="vldValue" runat="server" ControlToValidate="txtAmount" SetFocusOnError="true" ClientIDMode="Static"
                                ValidationExpression="^(?!0\d|$)\d*(\.\d{1,60})?$"
                                CssClass="errormessage field-validation-error" Display="Dynamic" ErrorMessage="Numbers with decimal points only.">
                                </asp:RegularExpressionValidator>--%>
                <asp:CustomValidator id="vldValue"
                    ControlToValidate="txtAmount"
                    ClientValidationFunction="validateAmount"
                    EnableClientScript="true"
                    Display="Dynamic"
                    ErrorMessage="Numbers with decimal points only. '0' is not allowed."
                    CssClass="errormessage field-validation-error"
                    SetFocusOnError="true" ClientIDMode="Static"
                    runat="server"/>
            </div>
            
        </div>
        <div class="row">
            <div class="label">
                Picture
            </div>
            <div class="input">
                 <uc:ImageSelector ID="imgSelectorPicture" Width="350" runat="server"></uc:ImageSelector>
            </div>
        </div>
        <div class="row">
            <div class="label">
                Diagram
            </div>
            <div class="input">
                 <uc:FileSelector ID="fileSelector" Width="350" runat="server"></uc:FileSelector>
            </div>
        </div>



        
        <div class="clear">
        </div>
    </div>
    <div class="section">
        <div class="section-title">
            Input / Output</div>
        <div class="row">
            <uc:InputOutput runat="server" ID="ctlInputOutput" ></uc:InputOutput>

        </div>
        <div class="clear">
        </div>
    </div>
    <div class="section">
        <div class="section-title">
            Transportation</div>
        <div class="row">
            <div class="transportation-editor">
                <div class="grid-block transportation-a">
                    <uc:TransportationA runat="server" ID="ctlTransportationA" />
                </div>
                <div class="grid-block transportation-b">
                    <uc:TransportationB runat="server" ID="ctlTransportationB" />
                </div>
                <div class="clearfix"></div>
            </div>

        </div>
        <div class="clear">
        </div>
    </div>
    <div class="row">
        <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
        <asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click"
            CausesValidation="false" />
    </div>
</div>
<script type="text/javascript" src="/Admin/Scripts/LCA/system_editor.js"></script>